'use strict';
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('Banners', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      cover: {
        allowNull: false,
        type: Sequelize.STRING,
      },
      pathname: {
        allowNull: false,
        type: Sequelize.STRING,
        defaultValue: ''
      },
      click: {
        allowNull: false,
        type: Sequelize.INTEGER(8),
        defaultValue: '0'
      },
      remark: {
        allowNull: false,
        type: Sequelize.STRING
      },
      appId: {
        allowNull: false,
        type: Sequelize.STRING(100),
        defaultValue: ''
      },
      status: {
        allowNull: false,
        type: Sequelize.INTEGER(1),
        defaultValue: '0'
      },
      type: {
        allowNull: false,
        type: Sequelize.INTEGER(1),
        defaultValue: '0'
      },
      goodsId: {
        type: Sequelize.INTEGER,
        allowNull: false,
        defaultValue: '0',
      },
      startedAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      endAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      deletedAt: {
        type: Sequelize.DATE
      }
    }, {
      charset: 'utf8mb4',
      collate: 'utf8mb4_general_ci',
      comment: '广告表'
    });
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('Banners');
  }
};